package com.situ.user.service.impl;

import com.situ.user.mapper.PicMapper;
import com.situ.user.service.PicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class PicServiceImpl implements PicService {
    @Autowired
    private PicMapper picMapper;

    @Override
    public List<String> getAll() {

        ArrayList<Map<String, String>> picList = picMapper.selectAll();
        List<String> pics=new ArrayList<>();

        for (Map<String,String> pic:
             picList) {

            if (pic!=null){
                pics.add(pic.get("name"));
            }

        }

        return pics;
    }
}
